#ifndef MAINWINDOW_HPP
# define MAINWINDOW_HPP

# include <QMainWindow>
# include <QTreeWidgetItem>
# include <QPixmap>
# include <QString>
# include <list>
# include <utility>
# include "TypeDefinition.hpp"
# include "Tab.hpp"
# include "MapManager.hpp"
# include "SpriteSheet.hpp"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
    void        initMenus();
    void        initWidgets();
    void        initResources();

    void        populateTreeView();

public slots:

    void        menuActionAbout();

    void        menuActionNewMap();
    void        menuActionLoadMap();
    void        menuActionSaveMap();
    void        menuActionSaveMapAs();
    void        menuActionImport();

    void        handleTreeWidgetClick(QTreeWidgetItem * item, int column);

    void        handleCloseTab(int index);

private:
    Ui::MainWindow *ui;

    std::list<SpriteSheet*> _treeViewPopulation;
    std::list<Tab*>         _tabs;
    MapManager              _mapManager;
};

#endif // MAINWINDOW_HPP
